package com.avery.mile.hadoop.rpc.hadoop;

import org.apache.hadoop.ipc.ProtocolSignature;

import java.io.IOException;

/**
 * Created by avery on 2018/12/26.
 */
public class HadoopRpcProtoclImpl implements HadoopRpcProtocol {
    public static final long versionID = 1L;

    public String sayHello(String nick) {
        return "welcome " + nick;
    }

    public long getProtocolVersion(String s, long l) throws IOException {
        return versionID;
    }

    public ProtocolSignature getProtocolSignature(String protocol,
                                                  long clientVersion,
                                                  int clientMethodsHash) throws IOException {
        return new ProtocolSignature(clientVersion, new int[]{clientMethodsHash});
    }
}
